package com.dev.dream.libs.preperences;

import android.content.Context;
import android.preference.CheckBoxPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.CheckBox;

import com.dev.dream.libs.mylib.R;

public class CustomCheckBoxPreference extends CheckBoxPreference {

	CheckBox cb;
	public CustomCheckBoxPreference(final Context context,
			final AttributeSet attrs, final int defStyle) {
		super(context, attrs, defStyle);

		this.setLayoutResource(R.layout.checkbox_preference);

		// this.mIcon = context.obtainStyledAttributes(attrs,
		// R.styleable.IconPreference, defStyle,
		// 0).getDrawable(R.styleable.IconPreference_icon);
	}

	public CustomCheckBoxPreference(final Context context,
			final AttributeSet attrs) {
		this(context, attrs, 0);
	}

	@Override
	protected void onBindView(final View view) {
		super.onBindView(view);
		
		cb = (CheckBox) view.findViewById(android.R.id.checkbox);
		cb.setChecked(isChecked());
		

		
	}
	
	

//	public void setCustomCheck(boolean isCheck){
//		cb.setChecked(isCheck);
//	}
//	
//	public boolean getCheck(){
//		return cb.isChecked();
//	}

	/**
	 * Sets the icon for this Preference with a Drawable.
	 * 
	 * @param icon
	 *            The icon for this Preference
	 */

}
